package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cheer.entity.OaLeamPeriodsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 期数
 * 
 * @author cheer
 */
@Mapper
@Repository
public interface OaLeamPeriodsDao extends BaseMapper<OaLeamPeriodsEntity> {

    default IPage<OaLeamPeriodsEntity> selectPage(Integer pageNum, Integer pageSize) {
        return selectPage(new Page<>(pageNum, pageSize), new QueryWrapper<OaLeamPeriodsEntity>()
            .orderByDesc("add_time"));
    }

    default List<OaLeamPeriodsEntity> selectList() {
        return selectList(new QueryWrapper<OaLeamPeriodsEntity>()
                .orderByDesc("add_time"));
    }
}
